package com.myapp.web.aop;

import java.lang.reflect.Method;
import org.springframework.aop.ClassFilter;
import org.springframework.aop.MethodMatcher;
import org.springframework.aop.Pointcut;
import com.opensymphony.xwork2.Action;

public class ActionPointcut implements Pointcut {

	@Override
	public ClassFilter getClassFilter() {
		return new ActionClassFilter();
	}

	@Override
	public MethodMatcher getMethodMatcher() {
		return new ActionMethodMatcher();
	}
}

class ActionClassFilter implements ClassFilter
{
	@Override
	public boolean matches(Class<?> claz) {
		return claz.isAssignableFrom(Action.class);
	}	
}

class ActionMethodMatcher implements MethodMatcher
{

	@Override
	public boolean isRuntime() {
		return true;
	}

	@Override
	public boolean matches(Method method, Class<?> claz) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean matches(Method method, Class<?> claz, Object[] obj) {
		// TODO Auto-generated method stub
		return false;
	}
	
}